[Apache] Following symbolic link

Hello all,

I use the following script to run a command on my linux machine:

<?php
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
?>

The script works fine if I use commands like cat ls dir. I get a output
back.

But now I made a symbolic link called groupmanager wich points to
/usr/lib/news/bin/ctlinnd. ctlinnd is a program to add a new group to a NNTP
server. normally this program should output "ok" or an error. but I get no
output. So the command isn;t executed. Its proberbly a security issue.

I added this to /etc/httpd/conf/httpd.conf

<Directory /usr/lib/news/bin>
Options All
AllowOverride All
</Directory>

My appache server is running under the user "apache".

I tried to do in the bash "sudo apache" to try the command manually under
this user... but it says the user isn;t available at the moment (even if I
shutdown apache)

if I type the command manual in the bash under user root everything works
fine.

I already performed chmod 777 on the files I need. but it stil doens;t works

anyone know what the problem here?
Joah Senegal [ Mo, 24 September 2007 18:17 ] [ ID #1827934 ]

Re: [Apache] Following symbolic link

Post removed (X-No-Archive: yes)
Notifier Deamon [ Mo, 24 September 2007 19:22 ] [ ID #1827937 ]

Re: [Apache] Following symbolic link

No it is possible with the above script. Read mij topicstart.... I already
performed succesfully commands like ls, dir, who, chmod and more. Only this
program (ctlinnd) wont execute with this method.

"Davide Bianchi" <davideyeahsure [at] onlyforfun.net> wrote in message
news:slrnfffsi8.37j.davideyeahsure [at] fogg.onlyforfun.net...
> On 2007-09-24, Joah Senegal <bloker [at] hva.nl> wrote:
>> But now I made a symbolic link called groupmanager wich points to
>> /usr/lib/news/bin/ctlinnd.
>
> You can't simply run any command out from a php script, the command is
> probably trying to open files, load libraries and the like and all this
> require different permissions. You either write a proper CGI script
> and use the correct permissions or use one of the many web interface to
> do the same things. Why re-inventing the wheel?
>
> Davide
>
> --
> It's nice to be loved, but there's a lot to be said for CRINGING RESPECT
> --Anonymous button bin
Joah Senegal [ Mo, 24 September 2007 21:48 ] [ ID #1827938 ]
Webserver » alt.apache.configuration » [Apache] Following symbolic link

Vorheriges Thema: How to construct these rewrite rules?
Nächstes Thema: CGI scripts can only read files in /var/www/ ?